package com.awesome.core.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.springframework.stereotype.Service;

import com.awesome.core.entity.User;
import com.awesome.core.mapper.UserMapper;
import com.awesome.core.service.IUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * <p>
 * user table 服务实现类
 * </p>
 *
 * @author Hongkai.Wang
 * @since 2020-12-10
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {

    @Override
    public User getByUserName(String userName) {
        LambdaQueryWrapper<User> queryWrapper = Wrappers.lambdaQuery();
        queryWrapper.eq(User::getNameEn, userName);
        return super.getOne(queryWrapper);
    }
}
